﻿@model IEnumerable<MC.RideEvent.Mvc.Models.ViewModel.VehiculeViewModel>

@{
    ViewBag.Title = "Mes Véhicules";
}

<h2>Vos Véhicules</h2>
<div id="gridVehicule"></div>
<script type="text/javascript">
    $(document).ready(function () {

    });
</script>

<div id="listvehicules" class="list">
    @foreach(var item in Model)
    {
        <div class="item-vehicule">
            <div class="field">
                <label>Immatriculation</label>
                <span>@item.Matricule</span>
            </div>
            <div class="field">
                <label>Nombre de place</label>
                <span>@item.NumberPlaces</span>
            </div>
            <div class="field">
                <label>Marque</label>
                <span>@item.VehiculeModel.VehiculeBrand.Title</span>
            </div>
            <div class="field">
                <label>Modele</label>
                <span>@item.VehiculeModel.Title</span>
            </div>
            <div class="action">
                <a id="btnvehiculeformedit" data-num="@item.Id" href="@Url.Action("VehiculeEditForm", "Member")?vehiculeId=@item.Id">
                    @* inserer une image avec le style *@
                    edit
                </a>
            </div>
        </div>
    }
</div>

<div id="formEditVehicule" style="display:none">
</div>

<script type="text/javascript">
    $(document).ready(function () {
        $(".action").on("click", "#btnvehiculeformedit", function (e) {
            $("#btnvehiculeformedit").fancybox({
                scrolling: 'no',
                titleShow: false,
                width: 400,
                height: 400,
                autoSize: false,
                type: 'ajax'
            });
        });
    });
</script>